//
// Created by Scave on 2025/8/29.
//

#ifndef RIDER3D_INSTANCINGRENDERSYSTEM_H
#define RIDER3D_INSTANCINGRENDERSYSTEM_H

#include "Define.h"
#include "entityx/System.h"
#include "component/Supposition.h"
#include "component/BasicComponents.h"
#include "render/RenderNode.h"

NS_RIDER_BEGIN

    class InstancingRenderSystem : public System<InstancingRenderSystem> {
    public:
        void configure(EntityManager& entities, EventManager& events) override;

        void update(EntityManager& entities, EventManager& events, TimeDelta dt) override;
    private:
        Mat4 ComputeViewMatrix(Camera* camera);
        Mat4 ComputeProjectionMatrix(Camera* camera);
        void CollectLights(EntityManager& entities, std::vector<LightItem>& lights);
    };

NS_RIDER_END

#endif //RIDER3D_INSTANCINGRENDERSYSTEM_H
